package com.automapper.constants;

public enum EnumAction {
	
	INSERT("insert","insert"),
	UPDATE("update","update"),
	DELETE("delete","delete"),
	PERSISTENT("persistent","persistent"),
	SELECT("select","select");
	
	private String key;
	private String value;
	
	private EnumAction(String key, String value) {
		this.key = key;
		this.value = value;
	}
	
	public static String getValue(String key) {
		for (EnumAction action : EnumAction.values()) {
			if (action.key.equalsIgnoreCase(key)) {
				return action.value;
			}
		}
		return null;
	}
	
	public String getKey() {
		return this.key;
	}
}
